package br.com.diego.system;

import br.com.diego.system.entity.DiegoRevisionEntity;
import org.hibernate.envers.RevisionListener;

public class DiegoRevisionListener implements RevisionListener {

    @Override
    public void newRevision(Object revisionEntity) {
        //Authentication a = SecurityContextHolder.getContext().getAuthentication();
        //String username = a.getName();
        String username = "usuario";

        DiegoRevisionEntity entity = (DiegoRevisionEntity) revisionEntity;
        entity.setUsername(username);
    }
}
